package com.smarthome.domain.enums;

public enum VerifyTokenType {
    SMS_REGISTER(1, "smarthome.register"), // 注册
    SMS_FIND_LOGIN_PWD(2, "smarthome.loginPwd.retrieve"), // 找回登录密码
    SMS_MOBILE_MODIFY(3, "smarthome.mobile.modify"), // 修改手机号
    SMS_MOBILE_VERIFY(4, "绑定新手机号") // 绑定新手机号
    ;

    private int type;// 类型
    private String comment;

    private VerifyTokenType(int type, String comment) {
        this.type = type;
        this.comment = comment;
    }

    public int getType() {
        return type;
    }

    public String getComment() {
        return comment;
    }

    public static VerifyTokenType getByType(int type) {
        for (VerifyTokenType vType : values()) {
            if (vType.getType() == type) {
                return vType;
            }
        }

        throw new IllegalArgumentException("none-defined type:" + type);
    }
}
